<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Module      :  GHC.ResponseFile</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- GCC style response files.</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- @since 4.12.0.0</span><span>
</span><span id="line-15"></span><span class="hs-comment">----------------------------------------------------------------------------</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Migrated from Haddock.</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.ResponseFile</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><a href="GHC.ResponseFile.html#getArgsWithResponseFiles"><span class="hs-identifier">getArgsWithResponseFiles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><a href="GHC.ResponseFile.html#unescapeArgs"><span class="hs-identifier">unescapeArgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>    </span><span class="annot"><a href="GHC.ResponseFile.html#escapeArgs"><span class="hs-identifier">escapeArgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>    </span><span class="annot"><a href="GHC.ResponseFile.html#expandResponse"><span class="hs-identifier">expandResponse</span></a></span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Exception.html"><span class="hs-identifier">Control.Exception</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Char.html"><span class="hs-identifier">Data.Char</span></a></span><span>          </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unicode.html#isSpace"><span class="hs-identifier">isSpace</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Foldable.html"><span class="hs-identifier">Data.Foldable</span></a></span><span>      </span><span class="hs-special">(</span><span class="annot"><a href="Data.Foldable.html#foldl%27"><span class="hs-identifier">foldl'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Environment.html"><span class="hs-identifier">System.Environment</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Environment.html#getArgs"><span class="hs-identifier">getArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Exit.html"><span class="hs-identifier">System.Exit</span></a></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="System.Exit.html#exitFailure"><span class="hs-identifier">exitFailure</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.IO.html"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">{-|
Like 'getArgs', but can also read arguments supplied via response files.


For example, consider a program @foo@:

@
main :: IO ()
main = do
  args &lt;- getArgsWithResponseFiles
  putStrLn (show args)
@


And a response file @args.txt@:

@
--one 1
--\'two\' 2
--&quot;three&quot; 3
@

Then the result of invoking @foo@ with @args.txt@ is:

&gt; &gt; ./foo @args.txt
&gt; [&quot;--one&quot;,&quot;1&quot;,&quot;--two&quot;,&quot;2&quot;,&quot;--three&quot;,&quot;3&quot;]

-}</span><span>
</span><span id="line-61"></span><span class="annot"><a href="GHC.ResponseFile.html#getArgsWithResponseFiles"><span class="hs-identifier hs-type">getArgsWithResponseFiles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-62"></span><span id="getArgsWithResponseFiles"><span class="annot"><span class="annottext">getArgsWithResponseFiles :: IO [String]
</span><a href="GHC.ResponseFile.html#getArgsWithResponseFiles"><span class="hs-identifier hs-var hs-var">getArgsWithResponseFiles</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO [String]
</span><a href="System.Environment.html#getArgs"><span class="hs-identifier hs-var">getArgs</span></a></span><span> </span><span class="annot"><span class="annottext">IO [String] -&gt; ([String] -&gt; IO [String]) -&gt; IO [String]
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
</span><a href="GHC.ResponseFile.html#expandResponse"><span class="hs-identifier hs-var">expandResponse</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- | Given a string of concatenated strings, separate each by removing</span><span>
</span><span id="line-65"></span><span class="hs-comment">-- a layer of /quoting/ and\/or /escaping/ of certain characters.</span><span>
</span><span id="line-66"></span><span class="hs-comment">--</span><span>
</span><span id="line-67"></span><span class="hs-comment">-- These characters are: any whitespace, single quote, double quote,</span><span>
</span><span id="line-68"></span><span class="hs-comment">-- and the backslash character.  The backslash character always</span><span>
</span><span id="line-69"></span><span class="hs-comment">-- escapes (i.e., passes through without further consideration) the</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- character which follows.  Characters can also be escaped in blocks</span><span>
</span><span id="line-71"></span><span class="hs-comment">-- by quoting (i.e., surrounding the blocks with matching pairs of</span><span>
</span><span id="line-72"></span><span class="hs-comment">-- either single- or double-quotes which are not themselves escaped).</span><span>
</span><span id="line-73"></span><span class="hs-comment">--</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- Any whitespace which appears outside of either of the quoting and</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- escaping mechanisms, is interpreted as having been added by this</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- special concatenation process to designate where the boundaries</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- are between the original, un-concatenated list of strings.  These</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- added whitespace characters are removed from the output.</span><span>
</span><span id="line-79"></span><span class="hs-comment">--</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- &gt; unescapeArgs &quot;hello\\ \\\&quot;world\\\&quot;\n&quot; == escapeArgs &quot;hello \&quot;world\&quot;&quot;</span><span>
</span><span id="line-81"></span><span class="annot"><a href="GHC.ResponseFile.html#unescapeArgs"><span class="hs-identifier hs-type">unescapeArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-82"></span><span id="unescapeArgs"><span class="annot"><span class="annottext">unescapeArgs :: String -&gt; [String]
</span><a href="GHC.ResponseFile.html#unescapeArgs"><span class="hs-identifier hs-var hs-var">unescapeArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; Bool) -&gt; [String] -&gt; [String]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (String -&gt; Bool) -&gt; String -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [String])
-&gt; (String -&gt; [String]) -&gt; String -&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="GHC.ResponseFile.html#unescape"><span class="hs-identifier hs-var">unescape</span></a></span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-comment">-- | Given a list of strings, concatenate them into a single string</span><span>
</span><span id="line-85"></span><span class="hs-comment">-- with escaping of certain characters, and the addition of a newline</span><span>
</span><span id="line-86"></span><span class="hs-comment">-- between each string.  The escaping is done by adding a single</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- backslash character before any whitespace, single quote, double</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- quote, or backslash character, so this escaping character must be</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- removed.  Unescaped whitespace (in this case, newline) is part</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- of this &quot;transport&quot; format to indicate the end of the previous</span><span>
</span><span id="line-91"></span><span class="hs-comment">-- string and the start of a new string.</span><span>
</span><span id="line-92"></span><span class="hs-comment">--</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- While 'unescapeArgs' allows using quoting (i.e., convenient</span><span>
</span><span id="line-94"></span><span class="hs-comment">-- escaping of many characters) by having matching sets of single- or</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- double-quotes,'escapeArgs' does not use the quoting mechasnism,</span><span>
</span><span id="line-96"></span><span class="hs-comment">-- and thus will always escape any whitespace, quotes, and</span><span>
</span><span id="line-97"></span><span class="hs-comment">-- backslashes.</span><span>
</span><span id="line-98"></span><span class="hs-comment">--</span><span>
</span><span id="line-99"></span><span class="hs-comment">-- &gt; unescapeArgs &quot;hello\\ \\\&quot;world\\\&quot;\\n&quot; == escapeArgs &quot;hello \&quot;world\&quot;&quot;</span><span>
</span><span id="line-100"></span><span class="annot"><a href="GHC.ResponseFile.html#escapeArgs"><span class="hs-identifier hs-type">escapeArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-101"></span><span id="escapeArgs"><span class="annot"><span class="annottext">escapeArgs :: [String] -&gt; String
</span><a href="GHC.ResponseFile.html#escapeArgs"><span class="hs-identifier hs-var hs-var">escapeArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="Data.OldList.html#unlines"><span class="hs-identifier hs-var">unlines</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; String)
-&gt; ([String] -&gt; [String]) -&gt; [String] -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="GHC.ResponseFile.html#escapeArg"><span class="hs-identifier hs-var">escapeArg</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-comment">-- | Arguments which look like @\@foo@ will be replaced with the</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- contents of file @foo@. A gcc-like syntax for response files arguments</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- is expected.  This must re-constitute the argument list by doing an</span><span>
</span><span id="line-106"></span><span class="hs-comment">-- inverse of the escaping mechanism done by the calling-program side.</span><span>
</span><span id="line-107"></span><span class="hs-comment">--</span><span>
</span><span id="line-108"></span><span class="hs-comment">-- We quit if the file is not found or reading somehow fails.</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- (A convenience routine for haddock or possibly other clients)</span><span>
</span><span id="line-110"></span><span class="annot"><a href="GHC.ResponseFile.html#expandResponse"><span class="hs-identifier hs-type">expandResponse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-111"></span><span id="expandResponse"><span class="annot"><span class="annottext">expandResponse :: [String] -&gt; IO [String]
</span><a href="GHC.ResponseFile.html#expandResponse"><span class="hs-identifier hs-var hs-var">expandResponse</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([[String]] -&gt; [String]) -&gt; IO [[String]] -&gt; IO [String]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[[String]] -&gt; [String]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [[String]] -&gt; IO [String])
-&gt; ([String] -&gt; IO [[String]]) -&gt; [String] -&gt; IO [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO [String]) -&gt; [String] -&gt; IO [[String]]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="#local-6989586621679565190"><span class="hs-identifier hs-var">expand</span></a></span><span>
</span><span id="line-112"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-113"></span><span>    </span><span class="annot"><a href="#local-6989586621679565190"><span class="hs-identifier hs-type">expand</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-114"></span><span>    </span><span id="local-6989586621679565190"><span class="annot"><span class="annottext">expand :: String -&gt; IO [String]
</span><a href="#local-6989586621679565190"><span class="hs-identifier hs-var hs-var">expand</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'@'</span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679565189"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565189"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="#local-6989586621679565188"><span class="hs-identifier hs-var">readFileExc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565189"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">IO String -&gt; (String -&gt; IO [String]) -&gt; IO [String]
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; IO [String])
-&gt; (String -&gt; [String]) -&gt; String -&gt; IO [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="GHC.ResponseFile.html#unescapeArgs"><span class="hs-identifier hs-var">unescapeArgs</span></a></span><span>
</span><span id="line-115"></span><span>    </span><span class="annot"><a href="#local-6989586621679565190"><span class="hs-identifier hs-var">expand</span></a></span><span> </span><span id="local-6989586621679565187"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565187"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565187"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span>    </span><span id="local-6989586621679565188"><span class="annot"><span class="annottext">readFileExc :: String -&gt; IO String
</span><a href="#local-6989586621679565188"><span class="hs-identifier hs-var hs-var">readFileExc</span></a></span></span><span> </span><span id="local-6989586621679565181"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565181"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-118"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; IO String
</span><a href="System.IO.html#readFile"><span class="hs-identifier hs-var">readFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565181"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">IO String -&gt; (IOException -&gt; IO String) -&gt; IO String
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="GHC.IO.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679565178"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679565178"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">IOException</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-119"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="GHC.IO.StdHandles.html#stderr"><span class="hs-identifier hs-var">stderr</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Error while expanding response file: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679565178"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><span class="annottext">IO String
forall a. IO a
</span><a href="System.Exit.html#exitFailure"><span class="hs-identifier hs-var">exitFailure</span></a></span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="hs-keyword">data</span><span> </span><span id="Quoting"><span class="annot"><a href="GHC.ResponseFile.html#Quoting"><span class="hs-identifier hs-var">Quoting</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="NoneQ"><span class="annot"><a href="GHC.ResponseFile.html#NoneQ"><span class="hs-identifier hs-var">NoneQ</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="SngQ"><span class="annot"><a href="GHC.ResponseFile.html#SngQ"><span class="hs-identifier hs-var">SngQ</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="DblQ"><span class="annot"><a href="GHC.ResponseFile.html#DblQ"><span class="hs-identifier hs-var">DblQ</span></a></span></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="annot"><a href="GHC.ResponseFile.html#unescape"><span class="hs-identifier hs-type">unescape</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-125"></span><span id="unescape"><span class="annot"><span class="annottext">unescape :: String -&gt; [String]
</span><a href="GHC.ResponseFile.html#unescape"><span class="hs-identifier hs-var hs-var">unescape</span></a></span></span><span> </span><span id="local-6989586621679565171"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565171"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [a] -&gt; [a]
</span><a href="GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [String])
-&gt; ([String] -&gt; [String]) -&gt; [String] -&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. [a] -&gt; [a]
</span><a href="GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [String]) -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565171"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#NoneQ"><span class="hs-identifier hs-var">NoneQ</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-127"></span><span>      </span><span class="hs-comment">-- n.b., the order of these cases matters; these are cribbed from gcc</span><span>
</span><span id="line-128"></span><span>      </span><span class="hs-comment">-- case 1: end of input</span><span>
</span><span id="line-129"></span><span>      </span><span id="local-6989586621679565169"><span class="annot"><span class="annottext">go :: String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span id="local-6989586621679565163"><span class="annot"><span class="annottext">Quoting
</span><a href="#local-6989586621679565163"><span class="hs-identifier hs-var">_q</span></a></span></span><span>    </span><span id="local-6989586621679565162"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679565162"><span class="hs-identifier hs-var">_bs</span></a></span></span><span>   </span><span id="local-6989586621679565161"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565161"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679565160"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565160"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565161"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565160"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-130"></span><span>      </span><span class="hs-comment">-- case 2: back-slash escape in progress</span><span>
</span><span id="line-131"></span><span>      </span><span class="annot"><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679565159"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565159"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679565158"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565158"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679565157"><span class="annot"><span class="annottext">Quoting
</span><a href="#local-6989586621679565157"><span class="hs-identifier hs-var">q</span></a></span></span><span>     </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>  </span><span id="local-6989586621679565156"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565156"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679565155"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565155"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565158"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="#local-6989586621679565157"><span class="hs-identifier hs-var">q</span></a></span><span>     </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565159"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565156"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565155"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-132"></span><span>      </span><span class="hs-comment">-- case 3: no back-slash escape in progress, but got a back-slash</span><span>
</span><span id="line-133"></span><span>      </span><span class="annot"><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679565154"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565154"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679565153"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565153"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679565152"><span class="annot"><span class="annottext">Quoting
</span><a href="#local-6989586621679565152"><span class="hs-identifier hs-var">q</span></a></span></span><span>     </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span id="local-6989586621679565151"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565151"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679565150"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565150"><span class="hs-keyword hs-var">as</span></a></span></span><span>
</span><span id="line-134"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565154"><span class="hs-identifier hs-var">c</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565153"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="#local-6989586621679565152"><span class="hs-identifier hs-var">q</span></a></span><span>     </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>  </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565151"><span class="hs-identifier hs-var">a</span></a></span><span>     </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565150"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-135"></span><span>      </span><span class="hs-comment">-- case 4: single-quote escaping in progress</span><span>
</span><span id="line-136"></span><span>      </span><span class="annot"><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679565149"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565149"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679565148"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565148"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#SngQ"><span class="hs-identifier hs-var">SngQ</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span id="local-6989586621679565147"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565147"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679565146"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565146"><span class="hs-keyword hs-var">as</span></a></span></span><span>
</span><span id="line-137"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565149"><span class="hs-identifier hs-var">c</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565148"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#NoneQ"><span class="hs-identifier hs-var">NoneQ</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565147"><span class="hs-identifier hs-var">a</span></a></span><span>     </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565146"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-138"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565148"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#SngQ"><span class="hs-identifier hs-var">SngQ</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565149"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565147"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565146"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-139"></span><span>      </span><span class="hs-comment">-- case 5: double-quote escaping in progress</span><span>
</span><span id="line-140"></span><span>      </span><span class="annot"><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679565145"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565145"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679565144"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565144"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#DblQ"><span class="hs-identifier hs-var">DblQ</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span id="local-6989586621679565143"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565143"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679565142"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565142"><span class="hs-keyword hs-var">as</span></a></span></span><span>
</span><span id="line-141"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565145"><span class="hs-identifier hs-var">c</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565144"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#NoneQ"><span class="hs-identifier hs-var">NoneQ</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565143"><span class="hs-identifier hs-var">a</span></a></span><span>     </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565142"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-142"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565144"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#DblQ"><span class="hs-identifier hs-var">DblQ</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565145"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565143"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565142"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-143"></span><span>      </span><span class="hs-comment">-- case 6: no escaping is in progress</span><span>
</span><span id="line-144"></span><span>      </span><span class="annot"><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679565141"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565141"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679565140"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565140"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#NoneQ"><span class="hs-identifier hs-var">NoneQ</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span id="local-6989586621679565139"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565139"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679565138"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565138"><span class="hs-keyword hs-var">as</span></a></span></span><span>
</span><span id="line-145"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565141"><span class="hs-identifier hs-var">c</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565140"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#NoneQ"><span class="hs-identifier hs-var">NoneQ</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565139"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565138"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565141"><span class="hs-identifier hs-var">c</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565140"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#SngQ"><span class="hs-identifier hs-var">SngQ</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565139"><span class="hs-identifier hs-var">a</span></a></span><span>     </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565138"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span>  </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565141"><span class="hs-identifier hs-var">c</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565140"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#DblQ"><span class="hs-identifier hs-var">DblQ</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565139"><span class="hs-identifier hs-var">a</span></a></span><span>     </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565138"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-148"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Quoting -&gt; Bool -&gt; String -&gt; [String] -&gt; [String]
</span><a href="#local-6989586621679565169"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565140"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">Quoting
</span><a href="GHC.ResponseFile.html#NoneQ"><span class="hs-identifier hs-var">NoneQ</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565141"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565139"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679565138"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span class="annot"><a href="GHC.ResponseFile.html#escapeArg"><span class="hs-identifier hs-type">escapeArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-151"></span><span id="escapeArg"><span class="annot"><span class="annottext">escapeArg :: String -&gt; String
</span><a href="GHC.ResponseFile.html#escapeArg"><span class="hs-identifier hs-var hs-var">escapeArg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. [a] -&gt; [a]
</span><a href="GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Char -&gt; String) -&gt; String -&gt; String -&gt; String
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Char -&gt; String
</span><a href="GHC.ResponseFile.html#escape"><span class="hs-identifier hs-var">escape</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="annot"><a href="GHC.ResponseFile.html#escape"><span class="hs-identifier hs-type">escape</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-154"></span><span id="escape"><span class="annot"><span class="annottext">escape :: String -&gt; Char -&gt; String
</span><a href="GHC.ResponseFile.html#escape"><span class="hs-identifier hs-var hs-var">escape</span></a></span></span><span> </span><span id="local-6989586621679565136"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565136"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span id="local-6989586621679565135"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565135"><span class="hs-identifier hs-var">c</span></a></span></span><span>
</span><span id="line-155"></span><span>  </span><span class="hs-glyph">|</span><span>    </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565135"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-156"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565135"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-157"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565135"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-158"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span>  </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565135"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565135"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565136"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-comment">-- n.b., our caller must reverse the result</span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679565135"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679565136"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-160"></span></pre></body></html>